package com.homelink.android.explorerup.adapter;

import android.content.Context;
import android.content.res.TypedArray;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.Gallery;
import android.widget.TextView;

import com.homelink.android.explorerup.R;

public class LocationAdapter extends BaseAdapter {
	private Context mContext;
	// private String mAbsPath;
	int mGalleryBackground;

	public LocationAdapter(Context c) {
		mContext = c;
		TypedArray attr = mContext.obtainStyledAttributes(R.styleable.path);
		mGalleryBackground = attr.getResourceId(
				R.styleable.path_android_galleryItemBackground, 0);

	}

	public int getCount() {
		// TODO Auto-generated method stub
		return 4;
	}

	public Object getItem(int arg0) {
		// TODO Auto-generated method stub
		return "Hongliang";
	}

	public long getItemId(int arg0) {
		// TODO Auto-generated method stub
		return 0;
	}

	public View getView(int arg0, View arg1, ViewGroup arg2) {
		// TODO Auto-generated method stub
		TextView tv = new TextView(mContext);
		tv.setLayoutParams(new Gallery.LayoutParams(150, 80));
		tv.setBackgroundResource(mGalleryBackground);
		tv.setText("HELLO");
		return tv;

	}

}
